#pragma once
#include <memory>

#include "View.h"
#include "SkCanvas.h"
#include "Animation.h"

class CalcAnimation;

class MeterView :
	public View, public AnimationDelegate
{
public:
	MeterView(View* parent);
	virtual ~MeterView();

	void setSpeed(int speed);

protected:
	virtual bool paint(SkCanvas* canvas);

	// AnimationDelegate
	virtual void animateStarted(Animation* animation);

	virtual void animateCompleted(Animation* animation);

	virtual void animateStep(Animation* animation);

	virtual void animateCanceled(Animation* animation);

	void startAnimate();
private:
	std::shared_ptr<CalcAnimation> animate_;
	bool anmation_change_;
	bool anmation_start_;

	int speed_;
	int last_speed_;
};

